package com.charlotte.study.gupao.command.player;

import java.util.ArrayList;
import java.util.List;

/**
 * @author junjie.ding
 * @date 2020/3/16
 */
public class Controller {

    private List<IAction> actionList = new ArrayList<>();

    public void addAction(IAction action){
        this.actionList.add(action);
    }

    public void execute(IAction action){
        action.execute();
    }

    public void executes(){
        for (IAction action : actionList) {
            action.execute();
        }
        actionList.clear();
    }
}
